Skip to content

Conversation

@MaxNumerique
Copy link
Contributor

…persistence

create project manager plugin for import/export operations update tests for new functionality and async loading

…persistence

create project manager plugin for import/export operations
update tests for new functionality and async loading
@MaxNumerique MaxNumerique changed the title feat(save_and_load): add save/load methods to all stores for project … feat(save_and_load): add import/export methods to all stores for project … Oct 30, 2025
@MaxNumerique MaxNumerique changed the title feat(save_and_load): add import/export methods to all stores for project … feat(save_and_load): add import/export methods Oct 30, 2025
@MaxNumerique MaxNumerique requested a review from BotellaA October 30, 2025 15:40
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JulienChampagnol que penses tu de cette proposition ?

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remaining comments which cannot be posted as a review comment to avoid GitHub Rate Limit


reported by reviewdog 🐶
Prefer await to then()/catch()/finally()

default: vi.fn(() => Promise.resolve({})),


reported by reviewdog 🐶
Prefer await to then()/catch()/finally()

viewer_call: vi.fn(() => Promise.resolve({})),


reported by reviewdog 🐶
Do not use Array#forEach

.forEach((store) => stores.app.registerStore(store))


reported by reviewdog 🐶
Do not use null literals


reported by reviewdog 🐶
Expected { after 'if' condition.

hybridViewerStoreMock.setZScaling(snapshot.zScale)


reported by reviewdog 🐶
Expected { after 'if' condition.

if (options.response_function) await options.response_function(response)


reported by reviewdog 🐶
Expected !== and instead saw !=


reported by reviewdog 🐶
Identifier name is too short (< 2).


reported by reviewdog 🐶
Identifier name is too short (< 2).


reported by reviewdog 🐶
Identifier name is too short (< 2).


reported by reviewdog 🐶
Identifier name is too short (< 2).

get: (k) => (k === "new-file-name" ? "project_123.zip" : null),


reported by reviewdog 🐶
Identifier name is too short (< 2).

(v) => typeof v === "function" && v.mockClear && v.mockClear(),


reported by reviewdog 🐶
The function has too many lines (85). Maximum allowed is 50.

describe("ProjectManager composable (compact)", () => {


reported by reviewdog 🐶
The async function has too many lines (52). Maximum allowed is 50.

test("importProjectFile with snapshot", async () => {


reported by reviewdog 🐶
Do not use null comparisons without type-checking operators.


reported by reviewdog 🐶
1


reported by reviewdog 🐶
2


reported by reviewdog 🐶
3


reported by reviewdog 🐶
0


reported by reviewdog 🐶
1


reported by reviewdog 🐶
0


reported by reviewdog 🐶
10


reported by reviewdog 🐶
11


reported by reviewdog 🐶
12


reported by reviewdog 🐶
0.1


reported by reviewdog 🐶
1000


reported by reviewdog 🐶
4

expect(viewer_call).toHaveBeenCalledTimes(4)


reported by reviewdog 🐶
1.5

expect(hybridViewerStoreMock.setZScaling).toHaveBeenCalledWith(1.5)


reported by reviewdog 🐶
Async function has no 'await' expression.

vi.fn(async () => ({ snapshot: snapshotMock })),


reported by reviewdog 🐶
Enforce test and it usage conventions

test("exportProject", async () => {


reported by reviewdog 🐶
Enforce test and it usage conventions

test("importProjectFile with snapshot", async () => {


reported by reviewdog 🐶
Enforces a maximum number assertion calls in a test body.

expect(hybridViewerStoreMock.importStores).toHaveBeenCalledWith(


reported by reviewdog 🐶
Enforces a maximum number assertion calls in a test body.

expect(hybridViewerStoreMock.setZScaling).toHaveBeenCalledWith(1.5)


reported by reviewdog 🐶
Enforces a maximum number assertion calls in a test body.

expect(dataStyleStoreMock.importStores).toHaveBeenCalledWith(


reported by reviewdog 🐶
Enforces a maximum number assertion calls in a test body.

expect(dataStyleStoreMock.applyAllStylesFromState).toHaveBeenCalled()


reported by reviewdog 🐶
Enforces a maximum number assertion calls in a test body.

expect(dataBaseStoreMock.registerObject).toHaveBeenCalledWith("abc123")


reported by reviewdog 🐶
Enforces a maximum number assertion calls in a test body.

expect(dataBaseStoreMock.addItem).toHaveBeenCalledWith(


reported by reviewdog 🐶
Enforces a maximum number assertion calls in a test body.

expect(treeviewStoreMock.addItem).toHaveBeenCalledWith(


reported by reviewdog 🐶
Enforces a maximum number assertion calls in a test body.

expect(hybridViewerStoreMock.addItem).toHaveBeenCalledWith("abc123")


reported by reviewdog 🐶
Enforces a maximum number assertion calls in a test body.

expect(dataStyleStoreMock.addDataStyle).toHaveBeenCalledWith(


reported by reviewdog 🐶
Enforces a maximum number assertion calls in a test body.

expect(dataStyleStoreMock.applyDefaultStyle).toHaveBeenCalledWith("abc123")


reported by reviewdog 🐶
Enforces a maximum number assertion calls in a test body.

expect(hybridViewerStoreMock.remoteRender).toHaveBeenCalled()


reported by reviewdog 🐶
Do not use setup or teardown hooks


reported by reviewdog 🐶
Suggest using toBeCalledWith() or toHaveBeenCalledWith().

expect(infraStoreMock.create_connection).toHaveBeenCalled()


reported by reviewdog 🐶
Suggest using toBeCalledWith() or toHaveBeenCalledWith().

expect(fileDownload).toHaveBeenCalled()


reported by reviewdog 🐶
Suggest using toBeCalledWith() or toHaveBeenCalledWith().

expect(infraStoreMock.create_connection).toHaveBeenCalled()


reported by reviewdog 🐶
Suggest using toBeCalledWith() or toHaveBeenCalledWith().

expect(viewerStoreMock.ws_connect).toHaveBeenCalled()


reported by reviewdog 🐶
Suggest using toBeCalledWith() or toHaveBeenCalledWith().

expect(hybridViewerStoreMock.initHybridViewer).toHaveBeenCalled()


reported by reviewdog 🐶
Suggest using toBeCalledWith() or toHaveBeenCalledWith().

expect(dataStyleStoreMock.applyAllStylesFromState).toHaveBeenCalled()


reported by reviewdog 🐶
Suggest using toBeCalledWith() or toHaveBeenCalledWith().

expect(hybridViewerStoreMock.remoteRender).toHaveBeenCalled()


reported by reviewdog 🐶
Enforce lowercase test names

describe("ProjectManager composable (compact)", () => {


reported by reviewdog 🐶
async is not allowed

importStores: vi.fn(async (snapshot) => {


reported by reviewdog 🐶
async is not allowed

vi.fn(async () => ({ snapshot: snapshotMock })),


reported by reviewdog 🐶
async is not allowed

api_fetch: vi.fn(async (_req, options = {}) => {


reported by reviewdog 🐶
async is not allowed


reported by reviewdog 🐶
async is not allowed

test("exportProject", async () => {


reported by reviewdog 🐶
async is not allowed

test("importProjectFile with snapshot", async () => {


reported by reviewdog 🐶
Optional chaining is not allowed.


reported by reviewdog 🐶
Optional chaining is not allowed.


reported by reviewdog 🐶
Expected catch or return

const infraStoreMock = { create_connection: vi.fn(() => Promise.resolve()) }


reported by reviewdog 🐶
Expected catch or return

const viewerStoreMock = { ws_connect: vi.fn(() => Promise.resolve()) }


reported by reviewdog 🐶
Expected catch or return

importStores: vi.fn(() => Promise.resolve()),


reported by reviewdog 🐶
Expected catch or return

addItem: vi.fn(() => Promise.resolve()),


reported by reviewdog 🐶
Expected catch or return

registerObject: vi.fn(() => Promise.resolve()),


reported by reviewdog 🐶
Expected catch or return

addItem: vi.fn(() => Promise.resolve()),


reported by reviewdog 🐶
Expected catch or return

importStores: vi.fn(() => Promise.resolve()),


reported by reviewdog 🐶
Expected catch or return

applyAllStylesFromState: vi.fn(() => Promise.resolve()),


reported by reviewdog 🐶
Expected catch or return

addDataStyle: vi.fn(() => Promise.resolve()),


reported by reviewdog 🐶
Expected catch or return

applyDefaultStyle: vi.fn(() => Promise.resolve()),


reported by reviewdog 🐶
Expected catch or return

initHybridViewer: vi.fn(() => Promise.resolve()),


reported by reviewdog 🐶
Expected catch or return

addItem: vi.fn(() => Promise.resolve()),


reported by reviewdog 🐶
Expected catch or return

viewer_call: vi.fn(() => Promise.resolve()),


reported by reviewdog 🐶
Prefer await to then()/catch()/finally()

const infraStoreMock = { create_connection: vi.fn(() => Promise.resolve()) }


reported by reviewdog 🐶
Prefer await to then()/catch()/finally()

const viewerStoreMock = { ws_connect: vi.fn(() => Promise.resolve()) }


reported by reviewdog 🐶
Prefer await to then()/catch()/finally()

importStores: vi.fn(() => Promise.resolve()),


reported by reviewdog 🐶
Prefer await to then()/catch()/finally()

addItem: vi.fn(() => Promise.resolve()),


reported by reviewdog 🐶
Prefer await to then()/catch()/finally()

registerObject: vi.fn(() => Promise.resolve()),


reported by reviewdog 🐶
Prefer await to then()/catch()/finally()

addItem: vi.fn(() => Promise.resolve()),


reported by reviewdog 🐶
Prefer await to then()/catch()/finally()

importStores: vi.fn(() => Promise.resolve()),


reported by reviewdog 🐶
Prefer await to then()/catch()/finally()

applyAllStylesFromState: vi.fn(() => Promise.resolve()),


reported by reviewdog 🐶
Prefer await to then()/catch()/finally()

addDataStyle: vi.fn(() => Promise.resolve()),


reported by reviewdog 🐶
Prefer await to then()/catch()/finally()

applyDefaultStyle: vi.fn(() => Promise.resolve()),


reported by reviewdog 🐶
Prefer await to then()/catch()/finally()

initHybridViewer: vi.fn(() => Promise.resolve()),


reported by reviewdog 🐶
Prefer await to then()/catch()/finally()

addItem: vi.fn(() => Promise.resolve()),


reported by reviewdog 🐶
Prefer await to then()/catch()/finally()

viewer_call: vi.fn(() => Promise.resolve()),


reported by reviewdog 🐶
Do not use Array#forEach


reported by reviewdog 🐶
Do not use null literals


reported by reviewdog 🐶
Do not use null literals


reported by reviewdog 🐶
Do not use null literals


reported by reviewdog 🐶
Do not use null literals

get: (k) => (k === "new-file-name" ? "project_123.zip" : null),


treeviewStore.isImporting = true

return Promise.resolve()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
Avoid nesting promises.


treeviewStore.isImporting = true

return Promise.resolve()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
Avoid nesting promises.


treeviewStore.isImporting = true

return Promise.resolve()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
Avoid nesting promises.


treeviewStore.isImporting = true

return Promise.resolve()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
Avoid nesting promises.


treeviewStore.isImporting = true

return Promise.resolve()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
Avoid nesting promises.

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remaining comments which cannot be posted as a review comment to avoid GitHub Rate Limit


reported by reviewdog 🐶
0


reported by reviewdog 🐶
10


reported by reviewdog 🐶
11


reported by reviewdog 🐶
12


reported by reviewdog 🐶
0.1


reported by reviewdog 🐶
1000


reported by reviewdog 🐶
4

expect(viewer_call).toHaveBeenCalledTimes(4)


reported by reviewdog 🐶
1.5

expect(hybridViewerStoreMock.setZScaling).toHaveBeenCalledWith(1.5)


reported by reviewdog 🐶
Async function has no 'await' expression.

vi.fn(async () => ({ snapshot: snapshotMock })),


reported by reviewdog 🐶
Enforce test and it usage conventions

test("exportProject", async () => {


reported by reviewdog 🐶
Enforce test and it usage conventions

test("importProjectFile with snapshot", async () => {


reported by reviewdog 🐶
Enforces a maximum number assertion calls in a test body.

expect(hybridViewerStoreMock.importStores).toHaveBeenCalledWith(


reported by reviewdog 🐶
Enforces a maximum number assertion calls in a test body.

expect(hybridViewerStoreMock.setZScaling).toHaveBeenCalledWith(1.5)


reported by reviewdog 🐶
Enforces a maximum number assertion calls in a test body.

expect(dataStyleStoreMock.importStores).toHaveBeenCalledWith(


reported by reviewdog 🐶
Enforces a maximum number assertion calls in a test body.

expect(dataStyleStoreMock.applyAllStylesFromState).toHaveBeenCalled()


reported by reviewdog 🐶
Enforces a maximum number assertion calls in a test body.

expect(dataBaseStoreMock.registerObject).toHaveBeenCalledWith("abc123")


reported by reviewdog 🐶
Enforces a maximum number assertion calls in a test body.

expect(dataBaseStoreMock.addItem).toHaveBeenCalledWith(


reported by reviewdog 🐶
Enforces a maximum number assertion calls in a test body.

expect(treeviewStoreMock.addItem).toHaveBeenCalledWith(


reported by reviewdog 🐶
Enforces a maximum number assertion calls in a test body.

expect(hybridViewerStoreMock.addItem).toHaveBeenCalledWith("abc123")


reported by reviewdog 🐶
Enforces a maximum number assertion calls in a test body.

expect(dataStyleStoreMock.addDataStyle).toHaveBeenCalledWith(


reported by reviewdog 🐶
Enforces a maximum number assertion calls in a test body.

expect(dataStyleStoreMock.applyDefaultStyle).toHaveBeenCalledWith("abc123")


reported by reviewdog 🐶
Enforces a maximum number assertion calls in a test body.

expect(hybridViewerStoreMock.remoteRender).toHaveBeenCalled()


reported by reviewdog 🐶
Do not use setup or teardown hooks


reported by reviewdog 🐶
Suggest using toBeCalledWith() or toHaveBeenCalledWith().

expect(infraStoreMock.create_connection).toHaveBeenCalled()


reported by reviewdog 🐶
Suggest using toBeCalledWith() or toHaveBeenCalledWith().

expect(fileDownload).toHaveBeenCalled()


reported by reviewdog 🐶
Suggest using toBeCalledWith() or toHaveBeenCalledWith().

expect(infraStoreMock.create_connection).toHaveBeenCalled()


reported by reviewdog 🐶
Suggest using toBeCalledWith() or toHaveBeenCalledWith().

expect(viewerStoreMock.ws_connect).toHaveBeenCalled()


reported by reviewdog 🐶
Suggest using toBeCalledWith() or toHaveBeenCalledWith().

expect(hybridViewerStoreMock.initHybridViewer).toHaveBeenCalled()


reported by reviewdog 🐶
Suggest using toBeCalledWith() or toHaveBeenCalledWith().

expect(dataStyleStoreMock.applyAllStylesFromState).toHaveBeenCalled()


reported by reviewdog 🐶
Suggest using toBeCalledWith() or toHaveBeenCalledWith().

expect(hybridViewerStoreMock.remoteRender).toHaveBeenCalled()


reported by reviewdog 🐶
Enforce lowercase test names

describe("ProjectManager composable (compact)", () => {


reported by reviewdog 🐶
async is not allowed

importStores: vi.fn(async (snapshot) => {


reported by reviewdog 🐶
async is not allowed

vi.fn(async () => ({ snapshot: snapshotMock })),


reported by reviewdog 🐶
async is not allowed

api_fetch: vi.fn(async (_req, options = {}) => {


reported by reviewdog 🐶
async is not allowed


reported by reviewdog 🐶
async is not allowed

test("exportProject", async () => {


reported by reviewdog 🐶
async is not allowed

test("importProjectFile with snapshot", async () => {


reported by reviewdog 🐶
Optional chaining is not allowed.


reported by reviewdog 🐶
Optional chaining is not allowed.


reported by reviewdog 🐶
Expected catch or return

const infraStoreMock = { create_connection: vi.fn(() => Promise.resolve()) }


reported by reviewdog 🐶
Expected catch or return

const viewerStoreMock = { ws_connect: vi.fn(() => Promise.resolve()) }


reported by reviewdog 🐶
Expected catch or return

importStores: vi.fn(() => Promise.resolve()),


reported by reviewdog 🐶
Expected catch or return

addItem: vi.fn(() => Promise.resolve()),


reported by reviewdog 🐶
Expected catch or return

registerObject: vi.fn(() => Promise.resolve()),


reported by reviewdog 🐶
Expected catch or return

addItem: vi.fn(() => Promise.resolve()),


reported by reviewdog 🐶
Expected catch or return

importStores: vi.fn(() => Promise.resolve()),


reported by reviewdog 🐶
Expected catch or return

applyAllStylesFromState: vi.fn(() => Promise.resolve()),


reported by reviewdog 🐶
Expected catch or return

addDataStyle: vi.fn(() => Promise.resolve()),


reported by reviewdog 🐶
Expected catch or return

applyDefaultStyle: vi.fn(() => Promise.resolve()),


reported by reviewdog 🐶
Expected catch or return

initHybridViewer: vi.fn(() => Promise.resolve()),


reported by reviewdog 🐶
Expected catch or return

addItem: vi.fn(() => Promise.resolve()),


reported by reviewdog 🐶
Expected catch or return

viewer_call: vi.fn(() => Promise.resolve()),


reported by reviewdog 🐶
Prefer await to then()/catch()/finally()

const infraStoreMock = { create_connection: vi.fn(() => Promise.resolve()) }


reported by reviewdog 🐶
Prefer await to then()/catch()/finally()

const viewerStoreMock = { ws_connect: vi.fn(() => Promise.resolve()) }


reported by reviewdog 🐶
Prefer await to then()/catch()/finally()

importStores: vi.fn(() => Promise.resolve()),


reported by reviewdog 🐶
Prefer await to then()/catch()/finally()

addItem: vi.fn(() => Promise.resolve()),


reported by reviewdog 🐶
Prefer await to then()/catch()/finally()

registerObject: vi.fn(() => Promise.resolve()),


reported by reviewdog 🐶
Prefer await to then()/catch()/finally()

addItem: vi.fn(() => Promise.resolve()),


reported by reviewdog 🐶
Prefer await to then()/catch()/finally()

importStores: vi.fn(() => Promise.resolve()),


reported by reviewdog 🐶
Prefer await to then()/catch()/finally()

applyAllStylesFromState: vi.fn(() => Promise.resolve()),


reported by reviewdog 🐶
Prefer await to then()/catch()/finally()

addDataStyle: vi.fn(() => Promise.resolve()),


reported by reviewdog 🐶
Prefer await to then()/catch()/finally()

applyDefaultStyle: vi.fn(() => Promise.resolve()),


reported by reviewdog 🐶
Prefer await to then()/catch()/finally()

initHybridViewer: vi.fn(() => Promise.resolve()),


reported by reviewdog 🐶
Prefer await to then()/catch()/finally()

addItem: vi.fn(() => Promise.resolve()),


reported by reviewdog 🐶
Prefer await to then()/catch()/finally()

viewer_call: vi.fn(() => Promise.resolve()),


reported by reviewdog 🐶
Do not use Array#forEach


reported by reviewdog 🐶
Do not use null literals


reported by reviewdog 🐶
Do not use null literals


reported by reviewdog 🐶
Do not use null literals


reported by reviewdog 🐶
Do not use null literals

get: (k) => (k === "new-file-name" ? "project_123.zip" : null),

initHybridViewer: vi.fn(() => Promise.resolve()),
importStores: vi.fn(async (snapshot) => {
if (snapshot?.zScale != null)
hybridViewerStoreMock.setZScaling(snapshot.zScale)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
Expected { after 'if' condition.

get: (k) => (k === "new-file-name" ? "project_123.zip" : null),
},
}
if (options.response_function) await options.response_function(response)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
Expected { after 'if' condition.

clear: vi.fn(),
initHybridViewer: vi.fn(() => Promise.resolve()),
importStores: vi.fn(async (snapshot) => {
if (snapshot?.zScale != null)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
Expected !== and instead saw !=

visibility: true,
coloring: {
active: "color",
color: { r: 255, g: 255, b: 255 },
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
Identifier name is too short (< 2).

visibility: true,
coloring: {
active: "color",
color: { r: 255, g: 255, b: 255 },
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
Identifier name is too short (< 2).

hybridViewer: {
zScale: 1.5,
camera_options: {
focal_point: [1, 2, 3],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
1

hybridViewer: {
zScale: 1.5,
camera_options: {
focal_point: [1, 2, 3],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
2

hybridViewer: {
zScale: 1.5,
camera_options: {
focal_point: [1, 2, 3],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
3

zScale: 1.5,
camera_options: {
focal_point: [1, 2, 3],
view_up: [0, 1, 0],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
0

zScale: 1.5,
camera_options: {
focal_point: [1, 2, 3],
view_up: [0, 1, 0],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
1

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remaining comments which cannot be posted as a review comment to avoid GitHub Rate Limit


reported by reviewdog 🐶
Enforce lowercase test names

describe("ProjectManager composable (compact)", () => {


reported by reviewdog 🐶
async is not allowed

importStores: vi.fn(async (snapshot) => {


reported by reviewdog 🐶
async is not allowed

vi.fn(async () => ({ snapshot: snapshotMock })),


reported by reviewdog 🐶
async is not allowed

api_fetch: vi.fn(async (_req, options = {}) => {


reported by reviewdog 🐶
async is not allowed


reported by reviewdog 🐶
async is not allowed

test("exportProject", async () => {


reported by reviewdog 🐶
async is not allowed

test("importProjectFile with snapshot", async () => {


reported by reviewdog 🐶
Optional chaining is not allowed.


reported by reviewdog 🐶
Optional chaining is not allowed.


reported by reviewdog 🐶
Expected catch or return

const infraStoreMock = { create_connection: vi.fn(() => Promise.resolve()) }


reported by reviewdog 🐶
Expected catch or return

const viewerStoreMock = { ws_connect: vi.fn(() => Promise.resolve()) }


reported by reviewdog 🐶
Expected catch or return

importStores: vi.fn(() => Promise.resolve()),


reported by reviewdog 🐶
Expected catch or return

addItem: vi.fn(() => Promise.resolve()),


reported by reviewdog 🐶
Expected catch or return

registerObject: vi.fn(() => Promise.resolve()),


reported by reviewdog 🐶
Expected catch or return

addItem: vi.fn(() => Promise.resolve()),


reported by reviewdog 🐶
Expected catch or return

importStores: vi.fn(() => Promise.resolve()),


reported by reviewdog 🐶
Expected catch or return

applyAllStylesFromState: vi.fn(() => Promise.resolve()),


reported by reviewdog 🐶
Expected catch or return

addDataStyle: vi.fn(() => Promise.resolve()),


reported by reviewdog 🐶
Expected catch or return

applyDefaultStyle: vi.fn(() => Promise.resolve()),


reported by reviewdog 🐶
Expected catch or return

initHybridViewer: vi.fn(() => Promise.resolve()),


reported by reviewdog 🐶
Expected catch or return

addItem: vi.fn(() => Promise.resolve()),


reported by reviewdog 🐶
Expected catch or return

viewer_call: vi.fn(() => Promise.resolve()),


reported by reviewdog 🐶
Prefer await to then()/catch()/finally()

const infraStoreMock = { create_connection: vi.fn(() => Promise.resolve()) }


reported by reviewdog 🐶
Prefer await to then()/catch()/finally()

const viewerStoreMock = { ws_connect: vi.fn(() => Promise.resolve()) }


reported by reviewdog 🐶
Prefer await to then()/catch()/finally()

importStores: vi.fn(() => Promise.resolve()),


reported by reviewdog 🐶
Prefer await to then()/catch()/finally()

addItem: vi.fn(() => Promise.resolve()),


reported by reviewdog 🐶
Prefer await to then()/catch()/finally()

registerObject: vi.fn(() => Promise.resolve()),


reported by reviewdog 🐶
Prefer await to then()/catch()/finally()

addItem: vi.fn(() => Promise.resolve()),


reported by reviewdog 🐶
Prefer await to then()/catch()/finally()

importStores: vi.fn(() => Promise.resolve()),


reported by reviewdog 🐶
Prefer await to then()/catch()/finally()

applyAllStylesFromState: vi.fn(() => Promise.resolve()),


reported by reviewdog 🐶
Prefer await to then()/catch()/finally()

addDataStyle: vi.fn(() => Promise.resolve()),


reported by reviewdog 🐶
Prefer await to then()/catch()/finally()

applyDefaultStyle: vi.fn(() => Promise.resolve()),


reported by reviewdog 🐶
Prefer await to then()/catch()/finally()

initHybridViewer: vi.fn(() => Promise.resolve()),


reported by reviewdog 🐶
Prefer await to then()/catch()/finally()

addItem: vi.fn(() => Promise.resolve()),


reported by reviewdog 🐶
Prefer await to then()/catch()/finally()

viewer_call: vi.fn(() => Promise.resolve()),


reported by reviewdog 🐶
Do not use Array#forEach


reported by reviewdog 🐶
Do not use null literals


reported by reviewdog 🐶
Do not use null literals


reported by reviewdog 🐶
Do not use null literals


reported by reviewdog 🐶
Do not use null literals

get: (k) => (k === "new-file-name" ? "project_123.zip" : null),

zScale: 1.5,
camera_options: {
focal_point: [1, 2, 3],
view_up: [0, 1, 0],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
0

camera_options: {
focal_point: [1, 2, 3],
view_up: [0, 1, 0],
position: [10, 11, 12],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
10

camera_options: {
focal_point: [1, 2, 3],
view_up: [0, 1, 0],
position: [10, 11, 12],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
11

camera_options: {
focal_point: [1, 2, 3],
view_up: [0, 1, 0],
position: [10, 11, 12],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
12

view_up: [0, 1, 0],
position: [10, 11, 12],
view_angle: 30,
clipping_range: [0.1, 1000],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
0.1


const { viewer_call } = await import("@/composables/viewer_call.js")

expect(infraStoreMock.create_connection).toHaveBeenCalled()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
Suggest using toBeCalledWith() or toHaveBeenCalledWith().

const { viewer_call } = await import("@/composables/viewer_call.js")

expect(infraStoreMock.create_connection).toHaveBeenCalled()
expect(viewerStoreMock.ws_connect).toHaveBeenCalled()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
Suggest using toBeCalledWith() or toHaveBeenCalledWith().

expect(treeviewStoreMock.importStores).toHaveBeenCalledWith(
snapshotMock.treeview,
)
expect(hybridViewerStoreMock.initHybridViewer).toHaveBeenCalled()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
Suggest using toBeCalledWith() or toHaveBeenCalledWith().

expect(dataStyleStoreMock.importStores).toHaveBeenCalledWith(
snapshotMock.dataStyle,
)
expect(dataStyleStoreMock.applyAllStylesFromState).toHaveBeenCalled()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
Suggest using toBeCalledWith() or toHaveBeenCalledWith().

)
expect(dataStyleStoreMock.applyDefaultStyle).toHaveBeenCalledWith("abc123")

expect(hybridViewerStoreMock.remoteRender).toHaveBeenCalled()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
Suggest using toBeCalledWith() or toHaveBeenCalledWith().

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remaining comments which cannot be posted as a review comment to avoid GitHub Rate Limit


reported by reviewdog 🐶
Expected catch or return

applyDefaultStyle: vi.fn(() => Promise.resolve()),


reported by reviewdog 🐶
Expected catch or return

initHybridViewer: vi.fn(() => Promise.resolve()),


reported by reviewdog 🐶
Expected catch or return

addItem: vi.fn(() => Promise.resolve()),


reported by reviewdog 🐶
Expected catch or return

viewer_call: vi.fn(() => Promise.resolve()),


reported by reviewdog 🐶
Prefer await to then()/catch()/finally()

const infraStoreMock = { create_connection: vi.fn(() => Promise.resolve()) }


reported by reviewdog 🐶
Prefer await to then()/catch()/finally()

const viewerStoreMock = { ws_connect: vi.fn(() => Promise.resolve()) }


reported by reviewdog 🐶
Prefer await to then()/catch()/finally()

importStores: vi.fn(() => Promise.resolve()),


reported by reviewdog 🐶
Prefer await to then()/catch()/finally()

addItem: vi.fn(() => Promise.resolve()),


reported by reviewdog 🐶
Prefer await to then()/catch()/finally()

registerObject: vi.fn(() => Promise.resolve()),


reported by reviewdog 🐶
Prefer await to then()/catch()/finally()

addItem: vi.fn(() => Promise.resolve()),


reported by reviewdog 🐶
Prefer await to then()/catch()/finally()

importStores: vi.fn(() => Promise.resolve()),


reported by reviewdog 🐶
Prefer await to then()/catch()/finally()

applyAllStylesFromState: vi.fn(() => Promise.resolve()),


reported by reviewdog 🐶
Prefer await to then()/catch()/finally()

addDataStyle: vi.fn(() => Promise.resolve()),


reported by reviewdog 🐶
Prefer await to then()/catch()/finally()

applyDefaultStyle: vi.fn(() => Promise.resolve()),


reported by reviewdog 🐶
Prefer await to then()/catch()/finally()

initHybridViewer: vi.fn(() => Promise.resolve()),


reported by reviewdog 🐶
Prefer await to then()/catch()/finally()

addItem: vi.fn(() => Promise.resolve()),


reported by reviewdog 🐶
Prefer await to then()/catch()/finally()

viewer_call: vi.fn(() => Promise.resolve()),


reported by reviewdog 🐶
Do not use Array#forEach


reported by reviewdog 🐶
Do not use null literals


reported by reviewdog 🐶
Do not use null literals


reported by reviewdog 🐶
Do not use null literals


reported by reviewdog 🐶
Do not use null literals

get: (k) => (k === "new-file-name" ? "project_123.zip" : null),

exportStores: vi.fn(() => ({ projectName: "mockedProject" })),
}))

describe("ProjectManager composable (compact)", () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
Enforce lowercase test names

const hybridViewerStoreMock = {
clear: vi.fn(),
initHybridViewer: vi.fn(() => Promise.resolve()),
importStores: vi.fn(async (snapshot) => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
async is not allowed

// Mocks
vi.stubGlobal(
"$fetch",
vi.fn(async () => ({ snapshot: snapshotMock })),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
async is not allowed

viewer_call: vi.fn(() => Promise.resolve()),
}))
vi.mock("@/composables/api_fetch.js", () => ({
api_fetch: vi.fn(async (_req, options = {}) => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
async is not allowed

}))

describe("ProjectManager composable (compact)", () => {
beforeEach(async () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
async is not allowed

}
const dataBaseStoreMock = {
clear: vi.fn(),
registerObject: vi.fn(() => Promise.resolve()),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
Expected catch or return

const dataBaseStoreMock = {
clear: vi.fn(),
registerObject: vi.fn(() => Promise.resolve()),
addItem: vi.fn(() => Promise.resolve()),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
Expected catch or return

addItem: vi.fn(() => Promise.resolve()),
}
const dataStyleStoreMock = {
importStores: vi.fn(() => Promise.resolve()),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
Expected catch or return

}
const dataStyleStoreMock = {
importStores: vi.fn(() => Promise.resolve()),
applyAllStylesFromState: vi.fn(() => Promise.resolve()),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
Expected catch or return

const dataStyleStoreMock = {
importStores: vi.fn(() => Promise.resolve()),
applyAllStylesFromState: vi.fn(() => Promise.resolve()),
addDataStyle: vi.fn(() => Promise.resolve()),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
Expected catch or return

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remaining comments which cannot be posted as a review comment to avoid GitHub Rate Limit


reported by reviewdog 🐶
Do not use null literals


reported by reviewdog 🐶
Do not use null literals


reported by reviewdog 🐶
Do not use null literals


reported by reviewdog 🐶
Do not use null literals

get: (k) => (k === "new-file-name" ? "project_123.zip" : null),

hybrid: useHybridViewerStore(),
}
Object.values(stores)
.slice(1)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
1

})

describe("Project import", () => {
test("app.importStores restores stores", async () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
Enforce test and it usage conventions

}),
}))

beforeEach(() => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
Do not use setup or teardown hooks

)
})

describe("Project import", () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
Enforce lowercase test names

}),
}))

beforeEach(() => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
Require test cases and hooks to be inside a describe block

importStores: vi.fn(() => Promise.resolve()),
applyAllStylesFromState: vi.fn(() => Promise.resolve()),
addDataStyle: vi.fn(() => Promise.resolve()),
applyDefaultStyle: vi.fn(() => Promise.resolve()),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
Prefer await to then()/catch()/finally()

}
const hybridViewerStoreMock = {
clear: vi.fn(),
initHybridViewer: vi.fn(() => Promise.resolve()),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
Prefer await to then()/catch()/finally()

hybridViewerStoreMock.remoteRender()
}
}),
addItem: vi.fn(() => Promise.resolve()),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
Prefer await to then()/catch()/finally()

vi.fn(async () => ({ snapshot: snapshotMock })),
)
vi.mock("@/composables/viewer_call.js", () => ({
viewer_call: vi.fn(() => Promise.resolve()),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
Prefer await to then()/catch()/finally()

dataStyleStoreMock,
hybridViewerStoreMock,
]) {
Object.values(store).forEach(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
Do not use Array#forEach

function finalizeImportSelection() {
const ids = pendingSelectionIds.value || []
const rebuilt = []
if (!ids.length) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
Unexpected negated condition.

components_selection.value = []
pendingSelectionIds.value = []
model_id.value = ""
selectedTree.value = undefined
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
Unexpected use of undefined

function finalizeImportSelection() {
const ids = pendingSelectionIds.value || []
const rebuilt = []
if (!ids.length) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
Use .length === 0 when checking length is zero.

panelWidth: 320,
model_id: "",
isTreeCollection: false,
selectedTree: null,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
Do not use null literals

coloring: {
active: "color",
color: { r: 255, g: 255, b: 255 },
vertex: null,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
Do not use null literals

clear: vi.fn(),
initHybridViewer: vi.fn(() => Promise.resolve()),
importStores: vi.fn(async (snapshot) => {
if (snapshot?.zScale != null)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
Do not use null literals

const response = {
_data: new Blob(["zipcontent"], { type: "application/zip" }),
headers: {
get: (k) => (k === "new-file-name" ? "project_123.zip" : null),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
Do not use null literals

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remaining comments which cannot be posted as a review comment to avoid GitHub Rate Limit


reported by reviewdog 🐶
Named exports are not allowed.

export function useProjectManager() {


reported by reviewdog 🐶
Prefer named exports

export default useProjectManager


reported by reviewdog 🐶
Each then() should return a value or throw


reported by reviewdog 🐶
Avoid nesting promises.

return Promise.resolve()


reported by reviewdog 🐶
Avoid nesting promises.

return Promise.resolve()


reported by reviewdog 🐶
Avoid nesting promises.

return Promise.resolve()


reported by reviewdog 🐶
Avoid nesting promises.

return Promise.resolve()


reported by reviewdog 🐶
Avoid nesting promises.

return Promise.resolve()


reported by reviewdog 🐶
Avoid nesting promises.

return Promise.resolve()


reported by reviewdog 🐶
Avoid nesting promises.

return Promise.resolve()


reported by reviewdog 🐶
Avoid nesting promises.

return Promise.resolve()


reported by reviewdog 🐶
Prefer await to then()/catch()/finally()


reported by reviewdog 🐶
Prefer await to then()/catch()/finally()

.then(function (result) {


reported by reviewdog 🐶
Prefer await to then()/catch()/finally()


reported by reviewdog 🐶
Prefer await to then()/catch()/finally()


reported by reviewdog 🐶
Prefer await to then()/catch()/finally()


reported by reviewdog 🐶
Prefer await to then()/catch()/finally()


reported by reviewdog 🐶
Prefer await to then()/catch()/finally()


reported by reviewdog 🐶
Prefer await to then()/catch()/finally()


reported by reviewdog 🐶
Prefer await to then()/catch()/finally()


reported by reviewdog 🐶
Prefer await to then()/catch()/finally()


reported by reviewdog 🐶
Prefer await to then()/catch()/finally()


reported by reviewdog 🐶
Prefer await to then()/catch()/finally()


reported by reviewdog 🐶
Prefer await to then()/catch()/finally()


reported by reviewdog 🐶
Prefer await to then()/catch()/finally()

return Promise.resolve()

import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_schemas.json"
import { once } from "lodash"

export function useProjectManager() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
Expected a function expression.

const geode = useGeodeStore()
const appStore = useAppStore()

const exportProject = function () {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
Unexpected unnamed function.


return infraStore
.create_connection()
.then(function () {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
Unexpected unnamed function.

return api_fetch(
{ schema, params: { snapshot, filename: defaultName } },
{
response_function: once(function (response) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
Unexpected unnamed function.

},
)
})
.finally(function () {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
Unexpected unnamed function.

: {}
const items = Object.entries(snapshotDataBase).map(function (pair) {
const id = pair[0]
const item = pair[1]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
1

const binaryLightViewable =
item && item.vtk_js && item.vtk_js.binary_light_viewable
? item.vtk_js.binary_light_viewable
: undefined
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
Unexpected use of undefined

? snapshot.dataBase.db
: {}
const items = Object.entries(snapshotDataBase).map(function (pair) {
const id = pair[0]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
Use Array destructuring.

: {}
const items = Object.entries(snapshotDataBase).map(function (pair) {
const id = pair[0]
const item = pair[1]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
Use Array destructuring.

import back_schemas from "@geode/opengeodeweb-back/opengeodeweb_back_schemas.json"
import fileDownload from "js-file-download"
import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_schemas.json"
import { once } from "lodash"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
Imports should be sorted alphabetically.

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remaining comments which cannot be posted as a review comment to avoid GitHub Rate Limit


reported by reviewdog 🐶
Prefer await to then()/catch()/finally()


reported by reviewdog 🐶
Prefer await to then()/catch()/finally()


reported by reviewdog 🐶
Prefer await to then()/catch()/finally()


reported by reviewdog 🐶
Prefer await to then()/catch()/finally()


reported by reviewdog 🐶
Prefer await to then()/catch()/finally()

return Promise.resolve()


reported by reviewdog 🐶
Unexpected block statement surrounding arrow body; move the returned value immediately after the =>.

const setModelEdgesVisibility = (id, visibility) => {


reported by reviewdog 🐶
Unexpected block statement surrounding arrow body; move the returned value immediately after the =>.

const modelEdgesVisibility = (id) => {


reported by reviewdog 🐶
Unexpected block statement surrounding arrow body; move the returned value immediately after the =>.

const exportStores = () => {


reported by reviewdog 🐶
Optional chaining is not allowed.

const objectType = meta?.object_type


reported by reviewdog 🐶
Each then() should return a value or throw


reported by reviewdog 🐶
Each then() should return a value or throw


reported by reviewdog 🐶
Each then() should return a value or throw

return meshStyleStore.applyMeshStyle(id).then(() => {


reported by reviewdog 🐶
Each then() should return a value or throw

return modelStyleStore.applyModelStyle(id).then(() => {


reported by reviewdog 🐶
Each then() should return a value or throw

return Promise.all(promises).then(() => {


reported by reviewdog 🐶
Prefer await to then()/catch()/finally()

return Promise.all([


reported by reviewdog 🐶
Prefer await to then()/catch()/finally()

return Promise.all([


reported by reviewdog 🐶
Prefer await to then()/catch()/finally()

return Promise.all(promises).then(() => {


reported by reviewdog 🐶
Wrapping single-element array with Promise.all() is unnecessary.

return Promise.all([


reported by reviewdog 🐶
Wrapping single-element array with Promise.all() is unnecessary.

return Promise.all([

const surfaces_defaultColor = { r: 20, g: 20, b: 20 }
const blocks_defaultVisibility = true
const blocks_defaultColor = { r: 20, g: 20, b: 20 }
const blocks_defaultColor = { r: 255, g: 255, b: 255 }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
Identifier name is too short (< 2).

const surfaces_defaultColor = { r: 20, g: 20, b: 20 }
const blocks_defaultVisibility = true
const blocks_defaultColor = { r: 20, g: 20, b: 20 }
const blocks_defaultColor = { r: 255, g: 255, b: 255 }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
Identifier name is too short (< 2).

const surfaces_defaultColor = { r: 20, g: 20, b: 20 }
const blocks_defaultVisibility = true
const blocks_defaultColor = { r: 20, g: 20, b: 20 }
const blocks_defaultColor = { r: 255, g: 255, b: 255 }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
Identifier name is too short (< 2).

import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_schemas.json"
import { once } from "lodash"

export function useProjectManager() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
Named exports are not allowed.

return { exportProject, importProjectFile }
}

export default useProjectManager
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
Prefer named exports

.then(function () {
return viewerStore.ws_connect()
})
.then(function () {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
Prefer await to then()/catch()/finally()


return infraStore
.create_connection()
.then(function () {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
Prefer await to then()/catch()/finally()

const dataStyleStore = useDataStyleStore()
return dataStyleStore.importStores(snapshot.dataStyle)
})
.then(function () {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
Prefer await to then()/catch()/finally()

.then(function () {
return hybridViewerStore.importStores(snapshot.hybridViewer)
})
.then(function () {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
Prefer await to then()/catch()/finally()


return importWorkflowFromSnapshot(items)
})
.then(function () {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
Prefer await to then()/catch()/finally()

.then(function () {
return hybridViewerStore.importStores(snapshot.hybridViewer)
})
.then(function () {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
Prefer await to then()/catch()/finally()

.then(function () {
return hybridViewerStore.initHybridViewer()
})
.then(function () {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
Prefer await to then()/catch()/finally()

.then(function () {
return treeviewStore.importStores(snapshot.treeview)
})
.then(function () {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
Prefer await to then()/catch()/finally()

treeviewStore.isImporting = true

return Promise.resolve()
.then(function () {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
Prefer await to then()/catch()/finally()


treeviewStore.isImporting = true

return Promise.resolve()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
Prefer await to then()/catch()/finally()

const lines_defaultColor = { r: 20, g: 20, b: 20 }
const surfaces_defaultVisibility = true
const surfaces_defaultColor = { r: 20, g: 20, b: 20 }
const surfaces_defaultColor = { r: 255, g: 255, b: 255 }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
Identifier name is too short (< 2).

const lines_defaultColor = { r: 20, g: 20, b: 20 }
const surfaces_defaultVisibility = true
const surfaces_defaultColor = { r: 20, g: 20, b: 20 }
const surfaces_defaultColor = { r: 255, g: 255, b: 255 }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
Identifier name is too short (< 2).

const lines_defaultColor = { r: 20, g: 20, b: 20 }
const surfaces_defaultVisibility = true
const surfaces_defaultColor = { r: 20, g: 20, b: 20 }
const surfaces_defaultColor = { r: 255, g: 255, b: 255 }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
Identifier name is too short (< 2).

function exportStores() {
const snapshotDb = {}
for (const [id, item] of Object.entries(db)) {
if (!item) continue
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
Expected { after 'if' condition.

return flat_indexes
}

function exportStores() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
Expected a function expression.

}
}

const setModelEdgesVisibility = (id, visibility) => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
Unexpected block statement surrounding arrow body; move the returned value immediately after the =>.

return modelStyleStore.setModelEdgesVisibility(id, visibility)
}

const modelEdgesVisibility = (id) => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
Unexpected block statement surrounding arrow body; move the returned value immediately after the =>.

return modelStyleStore.modelEdgesVisibility(id)
}

const exportStores = () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
Unexpected block statement surrounding arrow body; move the returned value immediately after the =>.

const meshStyleStore = useMeshStyle()
const modelStyleStore = useModelStyle()
const dataBaseStore = useDataBaseStore()
const hybridViewerStore = useHybridViewerStore()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
Variable 'hybridViewerStore' is declared but never used. Unused variables should start with a '_'.

const promises = []
for (const id of ids) {
const meta = dataBaseStore.itemMetaDatas(id)
const objectType = meta?.object_type
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
Optional chaining is not allowed.

}

export { importFile, importWorkflow }
async function importItemFromSnapshot(item) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
Expected a function expression.

return item.id
}

async function importWorkflowFromSnapshot(items) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
Expected a function expression.


const ids = []
for (const item of items) {
const id = await importItemFromSnapshot(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
Unexpected await inside a loop.

}

async function importWorkflowFromSnapshot(items) {
console.log("[importWorkflowFromSnapshot] start", { count: items?.length })
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
Unexpected console statement.

ids.push(id)
}
hybridViewerStore.remoteRender()
console.log("[importWorkflowFromSnapshot] done", { ids })
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
Unexpected console statement.

return ids
}

export { importFile, importWorkflow, importWorkflowFromSnapshot }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
Named exports are not allowed.

}

export { importFile, importWorkflow }
async function importItemFromSnapshot(item) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
async is not allowed

return item.id
}

async function importWorkflowFromSnapshot(items) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
async is not allowed

}

async function importWorkflowFromSnapshot(items) {
console.log("[importWorkflowFromSnapshot] start", { count: items?.length })
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
Optional chaining is not allowed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants